<?php
/**
 * 删除功能
 *
 *
 **/
//获取分类数据
$categoryId=$_GET['category_id'];

//保存到数据库
date_default_timezone_set("PRC");

$dsn="mysql:Server=127.0.0.1;dbname=blog";
$db= new PDO($dsn, "root", "123456");
$db ->exec("set names utf8mb4");

$sql ="delete from category where  category_id='$categoryId' ";
$result =$db->exec($sql);

if($result){
    echo "删除成功。<a href='category_list.php'>返回列表页面</a>";
    exit();
}else{
    echo "删除失败，错误信息。请联系管理人员：1974289078@qq.com";
}